package com.health.ts.service.topic;

import javax.annotation.Resource;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

import com.health.ts.service.sysmanage.SysDictService;

/**
 * @Auther: Administrator
 * @Date: 2018/7/9 11:01
 * @Description:
 */
@Component
public class RedisTopic2MessageListener implements MessageListener {
	
	@Resource
	SysDictService dictService;

	@Override
	public void onMessage(Message message, byte[] pattern) {
		System.out.println(new String(message.getChannel()));
        System.out.println(new String(message.getBody()));
        dictService.list();
	}

}